﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Columbus;
using Microsoft.Phone.Controls;

namespace SimpleMultiFrameApplication
{
    public partial class Shell : PhoneApplicationPage
    {
        // Constructor
        public Shell()
        {
            InitializeComponent();
            var shellViewModel = new ShellViewModel();
            DataContext = shellViewModel;
            Loaded += (x, y) =>
            {
                var navigationApp = shellViewModel.NavigationApplication;
                if (!navigationApp.InitializingAfterTombstoning)
                {
                    var navigator1 = navigationApp.GetNavigator("frame1");
                    var navigator2 = navigationApp.GetNavigator("frame2");
                    navigator1.NavigateTo<ApplicationController>(c => c.Page1());
                    navigator2.NavigateTo<ApplicationController>(c => c.Page2());
                }
            };
        }
    }
}